package com.jack.thinking.thread.core._1;

/**
 * this 和 Thread.currentThread()
 * @author wangbingwu
 *
 */
public class CountOperate extends Thread{
	public CountOperate() {
		System.out.println("CountOperate--begin");
		System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());
		System.out.println("this.getName()=" + this.getName());
		System.out.println("CountOperate--end");
	}
	
	@Override
	public void run() {
		System.out.println("run--begin");
		System.out.println("Thread.currentThread().getName()=" + Thread.currentThread().getName());
		try {
			Thread.sleep(100L);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		System.out.println("this.getName()=" + this.getName());
		System.out.println("run--end");
	}
	
	public static void main(String[] args) {
		CountOperate co = new CountOperate();
		Thread t = new Thread(co);
		t.setName("A");
		t.start();
	}
}
